<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<%@page import="karaoke.negocio.GestionLocal"%>
<%@page import="karaoke.modelo.Local"%>
<%@page import="karaoke.modelo.Empleado"%>
<%@page import="karaoke.modelo.Persona"%>
<%@page import="karaoke.servlets.BuscarLocalServlet"%>
<%@page import="karaoke.negocio.GestionLocal,java.util.*"%>
<%@page import="java.util.Collection, karaoke.excepcion.DAOExcepcion"%>



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<body class="preview" id="top">

	<div class="container">

		<div class="row">

			<div class="span8">

				<div class="well">

					<form class="form-horizontal well" name="frmBuscarLocal"
						method="post" action="BuscarLocalServlet">
						<fieldset>
							<legend>
								<h4>Busqueda de Local:</h4>
							</legend>

							<div class="control-group">
								<label class="control-label" for="input01">Nombre de
									Local:</label>
								<div class="controls">
									<input type="text" class="input-medium" id="txtnomlocal"
										name="txtnomprod">
								</div>

								<br></br>
								<table class="table table-striped">
									<tr>
										<td width="73"><div align="left">
												<strong>Id Local</strong>
											</div></td>
										<td width="90"><div align="left">
												<strong>Nombre Local</strong>
											</div></td>
										<td width="95"><div align="left">
												<strong>Direccion</strong>
											</div></td>
										<td width="95"><div align="left">
												<strong>Telefono</strong>
											</div></td>
										<td width="95"><div align="left">
												<strong>Administrador</strong>
											</div></td>
										<td width="95"><div align="left">
												<strong>Descripcion</strong>
											</div></td>

										<%@page
											import="java.util.Collection,java.util.ArrayList,karaoke.modelo.*"%>
										<%
	    Collection<Local> lista = new ArrayList<Local>();
		lista= (Collection<Local>) request.getAttribute("LISTALOCAL");
		
		if(lista!=null){
	  		for(Local local : lista){%>
									
									<tr>
										<div align="center">
											<td><%= local.getCodigo() %></td>
											<td><%= local.getNombre() %></td>
											<td><%= local.getDireccion() %></td>
											<td><%= local.getTelefono() %></td>
											<td><%= local.getAdministrador() %></td>
											<td><%= local.getDescripcion() %></td>
											<td><a
												href="LocalEditarServlet?idlocal=<%= local.getCodigo() %>">Editar</a>

												<%
            	if(local.getEliminado()==0)
            	{
            %>
											<td><a
												href="LocalEliminarServlet?idlocal=<%= local.getCodigo()%>&accion=E">Eliminar</a>
												<%
            	}
            	else if (local.getEliminado() == 1)
            	{
            %>
											<td><a
												href="LocalEliminarServlet?idlocal=<%= local.getCodigo()%>&accion=A">Activar</a>
												<%  
                }
            %></td>
										</div>
									</tr>
									<%
 		                            }
  	                }
      %>

									</tr>
								</table>

							</div>

							<div class="form-actions">
								<input type="submit" value="Buscar" id="evento_buscar"
									name="evento_buscar" /> <input type="button" name="Submit"
									value="Nuevo" onclick="window.location='nuevo_local.jsp'">

							</div>
						</fieldset>
					</form>
				</div>
			</div>
			<div class="span4"></div>
		</div>

		<footer>
		<p></p>
		</footer>

	</div>
	<!-- /container -->

	<!-- Le javascript
    ================================================== -->
	<script src="js/bootstrap-affix.js"></script>
	<script src="js/bootstrap-alert.js"></script>
	<script src="js/bootstrap-button.js"></script>
	<script src="js/bootstrap-carousel.js"></script>
	<script src="js/bootstrap-collapse.js"></script>
	<script src="js/bootstrap-dropdown.js"></script>
	<script src="js/bootstrap-modal.js"></script>
	<script src="js/bootstrap-tooltip.js"></script>
	<script src="js/bootstrap-popover.js"></script>
	<script src="js/bootstrap-scrollspy.js"></script>
	<script src="js/bootstrap-tab.js"></script>
	<script src="js/bootstrap-transition.js"></script>
	<script src="js/bootstrap-typeahead.js"></script>

	<script>
		$(function() {
			$( "#datepicker" ).datepicker();
		});
	</script>
</body>
</html>